<!DOCTYPE html>
<html>
	<head>
	    <meta charset="utf-8">
	    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
	    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
	    <title>Hello APP</title>
	    <link rel="stylesheet" type="text/css" href="../../css/index.css" />
	</head>
	<style type="text/css">
		.warp{width: 100%;}

		.info-box{width: 100%;}
		.info-box .info-one{align-items: center;height: 50px;padding: 0 15px;background: #FFFFFF;box-sizing: border-box;font-size: 14px;color: #4D4F50;}
		.info-box .info-one .r{text-align: right;padding: 10px 0;line-height: 30px;box-sizing: border-box;text-align: right;color: #FF9502;}
		.info-box .info-one.goto{background: url(../../image/main3/main3_goto.png) no-repeat right 10px center #FFFFFF;background-size:14px;padding-right: 30px;}


	</style>
	<body>
		<div id="vue" class="warp">
			<div class="info-box" v-if="Pdata">
				<div class="info-one flex goto">
	        		<div class="text">QQ</div>
	        		<div class="r flex1"  v-if="Pdata.qq">
						<span :data-id="Pdata.qq.id" tapmode onclick="jieBang(this)">已绑定</span>
					</div>
					<div class="r flex1" v-if="!Pdata.qq" ></div>
	        	</div>
	        	<div class="info-one flex goto">
	        		<div class="text">微信</div>
	        		<div class="r flex1"  v-if="Pdata.wxapp">
						<span :data-id="Pdata.wxapp.id" tapmode onclick="jieBang(this)">已绑定</span>
					</div>
					<div class="r flex1" v-if="!Pdata.wxapp" ></div>
	        	</div>
	        	<div class="info-one flex goto" v-if="type == 'ios' && banben >= 13">
	        		<div class="text">苹果</div>
	        		<div class="r flex1"  v-if="Pdata.ios">
						<span :data-id="Pdata.ios.id" tapmode onclick="jieBang(this)" >已绑定</span>
					</div>
					<div class="r flex1" v-if="!Pdata.ios"></div>
	        	</div>
			</div>
		</div>
	</body>
</html>
<script type="text/javascript" src="../../script/base.min.js" id="loadjs" data-js="L/swiper.min,L/lazyload,L/h-tool"></script>
<script type="text/javascript">
	define(function (require, exports, module) {

		var type = api.systemType;
		var sysver = api.systemVersion;
		var sysfver = sysver.split(".")[0];

		//console.log(JSON.stringify(type.osType));
		_page.getData = function(loading) {
			lanYun.getVueData({url:'user/getoauth',get:{},cache:0,loading:loading},function(ret) {
				//console.log(JSON.stringify(ret));
				if(ret.data.length == 0){
					lanYun.vue.Pdata = {};
				}
			});
		};
		lanYun.newVue('#vue',{
			type:type,
			banben:sysfver,
		},function() {
			_page.getData(0);
		});

		jieBang = function (tis) {
			var dst = tis.dataset;
			lanYun.alert({fname:'diaLogBox1',title:'提示', button:['取消','解绑'],content: '解绑后将不能使用第三方账号登录'},function(ret){
				if (ret.index == 0) return;
				lanYun.get('user/unoauth?id=' + dst.id ,function (ret){
					lanYun.toast(ret.msg);
					if(ret.errcode == 0){
						lanYun.ajaxPageSta = 0; lanYun.page = 1;
						_page.getData(2);
					}
				},2)
			});
		}


	});
</script>
